<include file="Public:header" />
<include file="Public:leftside" />

<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i>
				<a href="/">首页</a>
			</li>
			<li class="active">控制台</li>
		</ul>
	</div>
	<link rel="stylesheet" type="text/css" href="/static/css/ns_index.css" />
	<link rel="stylesheet" type="text/css" href="/static/css/ns_blue_common.css" />
	<script src="/static/js/highcharts.js"></script>
	<script src="/static/js/exporting.js"></script>
	<script src="/static/js/index.js"></script>
	<style type="text/css">
		.goods-state.order ul li {
		    width: 25%;
		    margin: 25px 0 10px 0;
		}
		hr{margin: 0;}
	</style>
	<div class="page-content" style="padding: 22px 10px 22px;">
		<div class="ns-main">

			<div class="statistical">
				<ul>
					<li class="order-amount-statistics">
						<header>
							<i class="ns-icon-base i-order-amount"></i>
							<span>今日订单总金额(元)</span>
						</header>
						<p class="js-order-amount">0.00</p>
					</li>
					<li class="focus-number-statistics">
						<header>
							<i class="ns-icon-base i-focus-number"></i>
							<span>关注人数(个)</span>
						</header>
						<p class="js-weixin-fans-count">0</p>
					</li>
					<li class="goods-release-statistics">
						<header>
							<i class="ns-icon-base i-goods-release"></i>
							<span>商品发布(个)</span>
						</header>
						<p class="js-goods-release-count">0</p>
					</li>
					<li class="order-total-statistics">
						<header>
							<i class="ns-icon-base i-order-total"></i>
							<span>订单总数(笔)</span>
						</header>
						<p class="js-order-total">0</p>
					</li>
					<li class="month-sales-statistics">
						<header>
							<i class="ns-icon-base i-month-sales"></i>
							<span>本月销量(笔)</span>
						</header>
						<p class="js-month-sales">0</p>
					</li>
					<li class="completed-transaction-statistics">
						<header>
							<i class="ns-icon-base i-completed-transaction"></i>
							<span>已完成交易(笔)</span>
						</header>
						<p class="js-order-finish-count">0</p>
					</li>
				</ul>
			</div>

		
				<div class="sales" style="height: 315px;">
				<h3>
					销售情况统计
				</h3>

				<table style="margin-top: 27px;">
					<tbody>
						<tr>
							<td colspan="2" align="left" style="padding: 15px 0 0 20px;">昨日销量</td>
						</tr>
						<tr>
							<td>
								<strong class="yesterday_goods">0</strong>
								<span>订单量(件)</span>
							</td>
							<td>
								<strong class="yesterday_money">0</strong>
								<span>订单金额(元)</span>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="left" style="padding: 15px 0 0 20px;">本月销量</td>
						</tr>
						<tr>
							<td>
								<strong class="month_goods">0</strong>
								<span>订单量(件)</span>
							</td>
							<td>
								<strong class="month_money">0</strong>
								<span>订单金额(元)</span>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="goods-prompt">
				<h3>
					交易提示
				</h3>
				<div class="subtitle">
				
				</div>
				<div class="goods-state a-line order" style="padding: 0 0 50px;">
					<ul>
						<li onclick="location.href='{:U("Order/order_list",array("status"=>10))}';">
							<h4 class="daifukuan">0</h4>待付款</li>
						<li onclick="location.href='{:U("Order/order_list",array("status"=>20))}';">
							<h4 class="daifahuo">0</h4>待发货</li>
						<li onclick="location.href='{:U("Order/order_list",array("status"=>30))}';">
							<h4 class="yifahuo">0</h4>已发货</li>
						<li onclick="location.href='{:U("Order/order_list",array("status"=>40))}';">
							<h4 class="yishouhuo">0</h4>已收货</li>
						<li onclick="location.href='{:U("Order/order_list",array("status"=>0))}';">
							<h4 class="yiguanbi">0</h4>已关闭</li>
						<li onclick="location.href='{:U("Order/order_list",array("refund_state"=>1))}';">
							<h4 class="tuikuanzhong">0</h4>退款/退货中</li>
						<li onclick="location.href='{:U("Order/order_list",array("refund_state"=>2))}';">
							<h4 class="tuikuanzhong2">0</h4>退款/退货完成</li>
					</ul>
				</div>
			</div>

		

			<div class="charts" style="width: 100%;">
				<h3>
					订单总数统计<span><i></i>订单数量</span>
				</h3>
				<div id="orderCharts"></div>

			</div>


			<script>
				$(function(){
					get_top_info();
					get_order();
					get_yestoday_order();
				})
				function get_top_info(){
					$.ajax({
						type : "post",
						url : "/Index/get_top_info",
						async : true,
						success : function(data) {	
							$(".js-order-amount").text(data.today_count);
							$(".js-weixin-fans-count").text(data.count_user);
							$(".js-goods-release-count").text(data.count_shop);
							$(".js-order-total").text(data.count_order);
							$(".js-month-sales").text(data.month_order);
							$(".js-order-finish-count").text(data.ycpay_order);
							
						}
					})
				}
				
				function get_order(){
					$.ajax({
						type : "post",
						url : "/Index/get_order",
						async : true,
						success : function(data) {	
							$(".daifukuan").text(data.wpay_order);
							$(".daifahuo").text(data.ypay_order);
							$(".yifahuo").text(data.yfpay_order);
							$(".yishouhuo").text(data.ycpay_order);
							$(".yiguanbi").text(data.close_order);
							$(".tuikuanzhong").text(data.back_order);
							$(".tuikuanzhong2").text(data.back_order2);
							
						}
					})
				}
				
				function get_yestoday_order(){
					$.ajax({
						type : "post",
						url : "/Index/get_yestoday_order",
						async : true,
						success : function(data) {	
							$(".yesterday_goods").text(data.count_num);
							$(".yesterday_money").text(data.count_price);
							$(".month_goods").text(data.m_count_num);
							$(".month_money").text(data.m_count_price);
						
						}
					})
				}
			</script>
		</div>
	</div>

	<include file="Public:footer" />